<template>
  <div>
    <table class="table table-bordered text-center table-vertical-middle table-sm">
      <colgroup>
        <col width="3%" />
        <col width="4%" />
        <col width="5%" />
        <col width="5%" />
        <col width="5%" />
        <col width="5%" />
        <col width="7%" />
        <col width="6%" />
        <col width="7%" />
        <col width="7%" />
        <col width="9%" />
        <col width="5%" />
        <col width="6%" />
        <col width="5%" />
        <col width="5%" />
        <col width="16%" />
      </colgroup>
      <tbody>
        <tr>
          <td colspan="16">
            <h3 class="m-0">银担合作情况统计表</h3>
          </td>
        </tr>
        <tr>
          <td class="bg-light" colspan="2">填报单位</td>
          <td colspan="3"></td>
          <td class="bg-light" colspan="2">填报部门及填报人员</td>
          <td colspan="2"></td>
          <td class="bg-light">联系方式</td>
          <td colspan="2"></td>
          <td class="bg-light" colspan="2">填报日期</td>
          <td colspan="2">年 月 日</td>
        </tr>
        <tr class="bg-light">
          <td rowspan="2">序号</td>
          <td rowspan="2"></td>
          <td rowspan="2">银行名称</td>
          <td rowspan="2">是否与省级分行签署合作协议</td>
          <td rowspan="2">银行授信额度（亿元）</td>
          <td colspan="2">本年度新增</td>
          <td colspan="2">本年度解除</td>
          <td colspan="2">在保情况</td>
          <td rowspan="2">保证金</td>
          <td rowspan="2">风险分担(银行分险比例)</td>
          <td rowspan="2">银行利率</td>
          <td rowspan="2">担保费率</td>
          <td rowspan="2">备注</td>
        </tr>
        <tr class="bg-light">
          <td>项目数(个)</td>
          <td>担保金额（万元）</td>
          <td>项目数(个)</td>
          <td>担保金额（万元）</td>
          <td>项目数(个)</td>
          <td>在保余额(万元)</td>
        </tr>
        <tr v-for="(bank, index) of totalTableData" :key="`1-${index}`">
          <td class="bg-light">{{ index + 1 }}</td>
          <template v-if="index === 0">
            <td :rowspan="totalTableData.length" class="bg-light">总对总战略合作银行</td>
          </template>
          <td class="bg-light">{{ bank.bankName }}</td>
          <td>{{ bank.hasSign }}</td>
          <td>{{ bank.creditFunds }}</td>
          <td>{{ bank.newProjectCount }}</td>
          <td>{{ bank.newGuaFunds }}</td>
          <td>{{ bank.outProjectCount }}</td>
          <td>{{ bank.outGuaFunds }}</td>
          <td>{{ bank.inProjectCount }}</td>
          <td>{{ bank.inGuaFunds }}</td>
          <td>{{ bank.bond }}</td>
          <td>{{ bank.riskRate }}</td>
          <td>{{ bank.bankRate }}</td>
          <td>{{ bank.guaRate }}</td>
          <td>{{ bank.remark }}</td>
        </tr>
        <tr v-for="(bank, index) of otherTableData" :key="`2-${index}`">
          <td class="bg-light">{{ index + 1 }}</td>
          <template v-if="index === 0">
            <td :rowspan="otherTableData.length" class="bg-light">其他全国性银行</td>
          </template>
          <td class="bg-light">{{ bank.bankName }}</td>
          <td>{{ bank.hasSign }}</td>
          <td>{{ bank.creditFunds }}</td>
          <td>{{ bank.newProjectCount }}</td>
          <td>{{ bank.newGuaFunds }}</td>
          <td>{{ bank.outProjectCount }}</td>
          <td>{{ bank.outGuaFunds }}</td>
          <td>{{ bank.inProjectCount }}</td>
          <td>{{ bank.inGuaFunds }}</td>
          <td>{{ bank.bond }}</td>
          <td>{{ bank.riskRate }}</td>
          <td>{{ bank.bankRate }}</td>
          <td>{{ bank.guaRate }}</td>
          <td>{{ bank.remark }}</td>
        </tr>
        <tr v-for="(bank, index) of localTableData" :key="`3-${index}`">
          <td class="bg-light">{{ index + 1 }}</td>
          <template v-if="index === 0">
            <td :rowspan="localTableData.length" class="bg-light">地方性银行</td>
          </template>
          <td class="bg-light">{{ bank.bankName }}</td>
          <td>{{ bank.hasSign }}</td>
          <td>{{ bank.creditFunds }}</td>
          <td>{{ bank.newProjectCount }}</td>
          <td>{{ bank.newGuaFunds }}</td>
          <td>{{ bank.outProjectCount }}</td>
          <td>{{ bank.outGuaFunds }}</td>
          <td>{{ bank.inProjectCount }}</td>
          <td>{{ bank.inGuaFunds }}</td>
          <td>{{ bank.bond }}</td>
          <td>{{ bank.riskRate }}</td>
          <td>{{ bank.bankRate }}</td>
          <td>{{ bank.guaRate }}</td>
          <td>{{ bank.remark }}</td>
        </tr>
        <tr v-for="(bank, index) of nonTableData" :key="`4-${index}`">
          <td class="bg-light">{{ index + 1 }}</td>
          <template v-if="index === 0">
            <td :rowspan="nonTableData.length" class="bg-light">其他非银行机构</td>
          </template>
          <td class="bg-light">{{ bank.bankName }}</td>
          <td>{{ bank.hasSign }}</td>
          <td>{{ bank.creditFunds }}</td>
          <td>{{ bank.newProjectCount }}</td>
          <td>{{ bank.newGuaFunds }}</td>
          <td>{{ bank.outProjectCount }}</td>
          <td>{{ bank.outGuaFunds }}</td>
          <td>{{ bank.inProjectCount }}</td>
          <td>{{ bank.inGuaFunds }}</td>
          <td>{{ bank.bond }}</td>
          <td>{{ bank.riskRate }}</td>
          <td>{{ bank.bankRate }}</td>
          <td>{{ bank.guaRate }}</td>
          <td>{{ bank.remark }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
const mockData = [
  {
    bankName: '农业银行',
    hasSign: '是',
    creditFunds: 50,
    newProjectCount: 9362,
    newGuaFunds: 158450.75,
    outProjectCount: 149,
    outGuaFunds: 4934.55,
    inProjectCount: 14648,
    inGuaFunds: 240495.473,
    bond: '无',
    riskRate: 0.2,
    bankRate: 0.047035,
    guaRate: 0.0164,
    remark: '六盘水市农担公司风险比例：“4321”模式',
    bankType: 1,
  },
  {
    bankName: '邮储银行',
    hasSign: '是',
    creditFunds: 7.75,
    newProjectCount: 26,
    newGuaFunds: 4576,
    outProjectCount: 1,
    outGuaFunds: 300,
    inProjectCount: 61,
    inGuaFunds: 11686,
    bond: 0.08,
    riskRate: 0.2,
    bankRate: 0.058415,
    guaRate: 0.0175,
    remark: '铜仁农担公司有8%的保证金',
    bankType: 1,
  },
  {
    bankName: '工商银行',
    hasSign: '否',
    creditFunds: 5,
    newProjectCount: 0,
    newGuaFunds: 0,
    outProjectCount: 32,
    outGuaFunds: 595,
    inProjectCount: 51,
    inGuaFunds: 910,
    bond: '无',
    riskRate: '',
    bankRate: 0.0435,
    guaRate: 0.0175,
    remark: '',
    bankType: 1,
  },
  {
    bankName: '建设银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '广发银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '招商银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '交通银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '兴业银行',
    hasSign: '否',
    creditFunds: 2,
    newProjectCount: 216,
    newGuaFunds: 808.85,
    outProjectCount: 1,
    outGuaFunds: 400,
    inProjectCount: 237,
    inGuaFunds: 921.15,
    bond: '',
    riskRate: 0.2,
    bankRate: 0.0435,
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '中信银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '北京银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '国开行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '农发行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '华夏银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '浦发银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '北京农商行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '渤海银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '光大银行',
    hasSign: '否',
    creditFunds: 0.5,
    newProjectCount: 3,
    newGuaFunds: 1300,
    outProjectCount: 0,
    outGuaFunds: 0,
    inProjectCount: 3,
    inGuaFunds: 1300,
    bond: '',
    riskRate: 0.2,
    bankRate: 0.045,
    guaRate: '',
    remark: '',
    bankType: 1,
  },
  {
    bankName: '进出口银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 2,
  },
  {
    bankName: '中国银行',
    hasSign: '是',
    creditFunds: 0.8,
    newProjectCount: 4,
    newGuaFunds: 1100,
    outProjectCount: 0,
    outGuaFunds: 0,
    inProjectCount: 4,
    inGuaFunds: 1100,
    bond: '',
    riskRate: 0.2,
    bankRate: 0.041375,
    guaRate: 0.0175,
    remark: '六盘水市农担公司风险比例：“4321”模式',
    bankType: 2,
  },
  {
    bankName: '民生银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 2,
  },
  {
    bankName: '平安银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 2,
  },
  {
    bankName: '浙商银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 2,
  },
  {
    bankName: '恒丰银行',
    hasSign: '否',
    creditFunds: '',
    newProjectCount: '',
    newGuaFunds: '',
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: '',
    inGuaFunds: '',
    bond: '',
    riskRate: '',
    bankRate: '',
    guaRate: '',
    remark: '',
    bankType: 2,
  },
  {
    bankName: '农信系统',
    hasSign: '是',
    creditFunds: 122,
    newProjectCount: 10442,
    newGuaFunds: 228976.9,
    outProjectCount: 1411,
    outGuaFunds: 30846.63,
    inProjectCount: 32524,
    inGuaFunds: 635691.537,
    bond: 0.1,
    riskRate: 0.2,
    bankRate: 0.05353,
    guaRate: 0.0115625,
    remark:
      '黔西南州均是黔农十二贷及农担产业贷合作模式、铜仁农担公司有10%的保证金，银行分险20%，产业贷项目银行分险98.5%、六盘水市农担公司风险比例：“4321”模式及全额',
    bankType: 2,
  },
  {
    bankName: '贵阳银行',
    hasSign: '是',
    creditFunds: 12.5,
    newProjectCount: 29,
    newGuaFunds: 6890,
    outProjectCount: 95,
    outGuaFunds: 2580,
    inProjectCount: 254,
    inGuaFunds: 57815,
    bond: 0.1,
    riskRate: 0.2,
    bankRate: 0.059435,
    guaRate: 0.01565,
    remark: '铜仁农担公司有10%的保证金',
    bankType: 3,
  },
  {
    bankName: '贵州银行',
    hasSign: '是',
    creditFunds: 3.7,
    newProjectCount: 5,
    newGuaFunds: 510,
    outProjectCount: 0,
    outGuaFunds: 0,
    inProjectCount: 22,
    inGuaFunds: 2405,
    bond: '无',
    riskRate: 0.2,
    bankRate: 0.051625,
    guaRate: 0.015,
    remark: '',
    bankType: 3,
  },
  {
    bankName: '中保财险',
    hasSign: '是',
    creditFunds: 1,
    newProjectCount: 0,
    newGuaFunds: 0,
    outProjectCount: 0,
    outGuaFunds: 0,
    inProjectCount: 2,
    inGuaFunds: 420,
    bond: '无',
    riskRate: 0.2,
    bankRate: 0.0565,
    guaRate: 0.015,
    remark: '',
    bankType: 3,
  },
  {
    bankName: '人保资本投资管理有限公司',
    hasSign: '否',
    creditFunds: '无固定',
    newProjectCount: 0,
    newGuaFunds: 0,
    outProjectCount: 2,
    outGuaFunds: 400,
    inProjectCount: 3,
    inGuaFunds: 320,
    bond: 0.1,
    riskRate: 0.2,
    bankRate: 0.06,
    guaRate: 0.02,
    remark: '',
    bankType: 4,
  },
  {
    bankName: '铜仁城乡消费合作社',
    hasSign: '否',
    creditFunds: '无固定',
    newProjectCount: 0,
    newGuaFunds: 0,
    outProjectCount: 0,
    outGuaFunds: 0,
    inProjectCount: 3,
    inGuaFunds: 900,
    bond: 0.1,
    riskRate: 0.2,
    bankRate: 0.06,
    guaRate: 0.02,
    remark: '',
    bankType: 4,
  },
  {
    bankName: '湖南省平安普惠小额贷款有限公司',
    hasSign: '否',
    creditFunds: '无固定',
    newProjectCount: 8,
    newGuaFunds: 800,
    outProjectCount: '',
    outGuaFunds: '',
    inProjectCount: 33,
    inGuaFunds: 3250,
    bond: '',
    riskRate: 0.2,
    bankRate: 0.025,
    guaRate: 0.015,
    remark: '',
    bankType: 4,
  },
]

export default {
  components: {},
  props: {
    visible: Boolean,
  },
  data() {
    return {
      totalTableData: [],
      otherTableData: [],
      localTableData: [],
      nonTableData: [],
    }
  },
  computed: {},
  watch: {},
  created() {
    this.getData()
  },
  mounted() {},
  methods: {
    getData() {
      this.totalTableData = []
      this.otherTableData = []
      this.localTableData = []
      this.nonTableData = []
      for (const d of mockData) {
        if (d.bankType === 1) {
          this.totalTableData.push(d)
        } else if (d.bankType === 2) {
          this.otherTableData.push(d)
        } else if (d.bankType === 3) {
          this.localTableData.push(d)
        } else {
          this.nonTableData.push(d)
        }
      }
    },
  },
}
</script>

<style lang="scss" scoped></style>
